﻿<phone:PhoneApplicationPage
    x:Class="OnlineMovies.Views.AddCast"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate  x:Key="tblkcat">
            <TextBlock Foreground="White" FontSize="40" FontFamily="Calibri" FontWeight="Normal" LineHeight="60" Loaded="TextBlock_Loaded_1"  Text="{Binding}" ></TextBlock>
        </DataTemplate>
        <Style TargetType="toolkit:ListPicker" x:Key="style">
            <Setter Property="Background" Value="{StaticResource PhoneTextBoxBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneTextBoxForegroundBrush}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
            <Setter Property="HorizontalContentAlignment" Value="Left"/>
            <Setter Property="Margin" Value="{StaticResource PhoneTouchTargetOverhang}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="toolkit:ListPicker">
                        <StackPanel>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="PickerStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="Expanded">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="Border" 
                                            Storyboard.TargetProperty="Background" 
                                            Duration="0">
                                                <DiscreteObjectKeyFrame 
                                                Value="White" 
                                                KeyTime="0"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames 
                                            Storyboard.TargetName="Border" 
                                            Storyboard.TargetProperty="BorderBrush" 
                                            Duration="0">
                                                <DiscreteObjectKeyFrame 
                                                Value="{StaticResource PhoneTextBoxEditBorderBrush}" 
                                                KeyTime="0"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentControl 
                            Content="{TemplateBinding Header}" 
                            ContentTemplate="{TemplateBinding HeaderTemplate}" 
                            Foreground="{StaticResource PhoneSubtleBrush}" 
                            FontSize="{StaticResource PhoneFontSizeNormal}" 
                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                            Margin="0 0 0 8"/>
                            <Grid>
                                <Border 
                                x:Name="Border" 
                                Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding Background}" 
                                BorderThickness="2">
                                    <Canvas x:Name="ItemsPresenterHost" MinHeight="46">
                                        <ItemsPresenter x:Name="ItemsPresenter">
                                            <ItemsPresenter.RenderTransform>
                                                <TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
                                            </ItemsPresenter.RenderTransform>
                                        </ItemsPresenter>
                                    </Canvas>
                                </Border>
                                <Popup x:Name="FullModePopup">
                                    <Border Background="{StaticResource PhoneChromeBrush}">
                                        <!-- Popup.Child should always be a Border -->
                                        <Grid>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto"/>
                                                <RowDefinition/>
                                            </Grid.RowDefinitions>
                                            <ContentControl 
                                            Grid.Row="0" 
                                            Content="{TemplateBinding FullModeHeader}" 
                                            Foreground="{StaticResource PhoneForegroundBrush}" 
                                            FontFamily="{StaticResource PhoneFontFamilySemiBold}" 
                                            FontSize="{StaticResource PhoneFontSizeMedium}" 
                                            HorizontalAlignment="Left" 
                                            Margin="24 12 0 0"/>
                                            <ListBox 
                                            x:Name="FullModeSelector" 
                                            Grid.Row="1" 
                                           
                                            FontSize="{TemplateBinding FontSize}" 
                                            Margin="{StaticResource PhoneMargin}">
                                                <ListBox.ItemsPanel>
                                                    <ItemsPanelTemplate>
                                                        <StackPanel/>
                                                        <!-- Ensures all containers will be available during the Loaded event -->
                                                    </ItemsPanelTemplate>
                                                </ListBox.ItemsPanel>
                                            </ListBox>
                                        </Grid>
                                    </Border>
                                </Popup>
                            </Grid>
                        </StackPanel>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="{StaticResource bipivot}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="10,17,0,28" Orientation="Horizontal">
            <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle"  MouseLeftButtonDown="imgTitle_MouseEnter"/>
            <TextBlock x:Name="tblkVideosTitle"  Style="{StaticResource CastPageHeaderText}" />
        </StackPanel>
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
              
            </Grid.RowDefinitions>
            <StackPanel Orientation="Vertical" Grid.Row="0" Margin="0,15,0,0">
                <StackPanel Orientation="Horizontal">
                    <TextBlock  Style="{StaticResource Personnametitle}" ></TextBlock>
                    <TextBlock x:Name="valid" Text="Required" FontSize="16" Foreground="Red" Margin="10,4,0,0" Visibility="Collapsed"></TextBlock>
                </StackPanel>
                <toolkit:AutoCompleteBox InputScope="Text" SelectionChanged="tblkpersonname_SelectionChanged_1"  Name="tblkpersonname" Width="500"  Margin="0,-7,0,0"  ValueMemberBinding="{Binding Name}" FilterMode="Contains" ItemsSource="{Binding}" KeyUp="tblkpersonname_KeyUp_1"  Height="73">
                    <toolkit:AutoCompleteBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" Tag="{Binding PersonID}"></TextBlock>
                        </DataTemplate>
                    </toolkit:AutoCompleteBox.ItemTemplate>
                </toolkit:AutoCompleteBox>
                <!--<TextBox x:Name="tblkpersonname" Width="500"  HorizontalAlignment="Left"></TextBox>-->
            </StackPanel>
            <StackPanel x:Name="desstk" Orientation="Vertical" Grid.Row="1" >
                <StackPanel x:Name="onl" Orientation="Horizontal">
                    <TextBlock Style="{StaticResource Persondecriptiontitle}" ></TextBlock>
                    <Image Source="/Images/online.png" Margin="20,0,0,0" Height="48" Width="48" x:Name="persondes" MouseLeftButtonDown="persondes_MouseLeftButtonDown_1" ></Image>
                    <Image x:Name="edit"  Source="/Images/PlayerImages/edit.png" Margin="25,0,0,0" Stretch="Fill" Height="48" Width="48" MouseLeftButtonDown="edit_MouseLeftButtonDown_1" ></Image>
                    <TextBlock x:Name="txtlength" Visibility="Visible"  Margin="40,30,0,0" HorizontalAlignment="Right" Foreground="White" FontSize="20"></TextBlock>
                </StackPanel>
                <StackPanel Orientation="Vertical">
                    <TextBox x:Name="tblkdes" Width="500" ScrollViewer.VerticalScrollBarVisibility="Auto"  TextWrapping="Wrap" HorizontalAlignment="Left" TextChanged="tblkdes_TextChanged_1" Height="150"></TextBox>
                    <TextBlock x:Name="txtlimit" Visibility="Collapsed" Margin="-20,-5,0,0" Text="max text limit 150 characters" Foreground="Red" FontSize="20"></TextBlock>
                </StackPanel>
            </StackPanel>
            <StackPanel x:Name="rolestk" Orientation="Vertical" Grid.Row="2" >
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource Personroletitle}"></TextBlock>
                    <TextBlock x:Name="validrole" Text="Required" FontSize="16" Foreground="Red" Margin="30,4,0,0" Visibility="Collapsed"></TextBlock>
                </StackPanel>
                <toolkit:ListPicker  Style="{StaticResource style}" x:Name="lpicrole" Margin="10,0,0,0" HorizontalAlignment="Left" Width="500" FontSize="22" FullModeItemTemplate="{StaticResource tblkcat}" FullModeHeader="Choose Role" >
                    <!--<toolkit:ListPickerItem Margin="120,0,0,0" Content="Choose Role"></toolkit:ListPickerItem>
                    <toolkit:ListPickerItem Content="Actor" Margin="120,0,0,0"></toolkit:ListPickerItem>
                    <toolkit:ListPickerItem Content="Director" Margin="120,0,0,0"></toolkit:ListPickerItem>
                    <toolkit:ListPickerItem Content="Music Director" Margin="120,0,0,0"></toolkit:ListPickerItem>
                    <toolkit:ListPickerItem Content="Producer" Margin="120,0,0,0"></toolkit:ListPickerItem>-->
                </toolkit:ListPicker>
                <!--<TextBox x:Name="tblkrole" Width="300" ScrollViewer.VerticalScrollBarVisibility="Auto"  TextWrapping="Wrap" HorizontalAlignment="Left"></TextBox>-->
            </StackPanel>
            <StackPanel 
                Orientation="Horizontal" 
                Grid.Row="3" 
                Margin="0,-15,0,0">
                <StackPanel 
                    x:Name="persononlocalstk" 
                    Orientation="Vertical">
                    <TextBlock  
                        Text="Image From Local" 
                        Foreground="White" 
                        Margin="15,20,0,0">                        
                    </TextBlock>
                    <Image Source="/Images/peoplefromlocal.png" 
                           x:Name="personlocalimg" 
                           Height="110" 
                           Margin="10,15,0,0" 
                           Width="120" 
                           MouseLeftButtonDown="personlocalimg_MouseLeftButtonDown_1">                        
                    </Image>
                </StackPanel>
                <StackPanel 
                    x:Name="persononlinestk" 
                    Orientation="Vertical" 
                    Margin="80,0,0,0">
                    <TextBlock  
                        Text="Image From Online" 
                         
                        Margin="15,20,0,0">                        
                    </TextBlock>
                    <Image Source="/Images/peoplefromonline.png" 
                           x:Name="persononlineimg" 
                           Height="110" 
                           Margin="10,15,0,0" 
                           Width="120" 
                           MouseLeftButtonDown="persononlineimg_MouseLeftButtonDown_1">                        
                    </Image>
                </StackPanel>
                <!--<TextBox x:Name="tblkimg" Width="400" ScrollViewer.VerticalScrollBarVisibility="Auto"  TextWrapping="Wrap"  HorizontalAlignment="Left"></TextBox>-->
            </StackPanel>
           
        </Grid>
        <StackPanel  Name="adstackpl" Grid.Row="2" Orientation="Vertical"  Margin="1,0,2,0" Height="80" >
        </StackPanel>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>

        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">

            <shell:ApplicationBarIconButton x:Name="btnsave" IconUri="/Images/PlayerImages/save.png" Text="Save" Click="btnsave_Click_1"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>